-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys/shell: print error code of command #17922
base: master
Are you sure you want to change the base?
Conversation
What about exit codes > 0? I think e.g. This might break some shell abstractions btw. that habe baked in some expectations about the shell output format. |
I just noticed that some commands would print positive error if the number of arguments was wrong and they would print a help instead. |
For the "print help" the error code may not be as helpful, as the error message ("Usage: %s gadget [--arg]") is not what the command line parser knows anyway. Suggestion: On negative codes, print strerror(e); on positive, keep relying on the command to have printed its error. (The codes might still later get more effects, like setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm now strerror()
adds too much ROM on small boards (and kills the AVR family where this is then placed in RAM).
This wants me to have multiple levels of DEVELHELP
again so we could set DEVELHELP=2
to get these more expensive features.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
I've written code like
way too often.
Let's let the shell always print the error code of shell commands, as it is otherwise just discarded.
Testing procedure
Try your favorite shell commands.
Issues/PRs references